package com.bdmc.smokesensor.entity;

import java.util.Date;

import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;

@Data
@Entity
@Table(name = "sys_log")
public class Sys_Log {
    public Sys_Log(String _loginName,String _ip,String _page,String _detail){
        this.loginName=_loginName;
        this.ip=_ip;
        this.page=_page;
        this.detail=_detail;
        this.joinDate = new Date();
    }
    public Sys_Log(){

    }

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)    
    @Column(name = "id")
    private int id;
    @Column(name = "loginName", length = 50)
    private String loginName;
    @Column(name = "ip", length = 50)
    private String ip;
    @Column(name = "page",length = 50)
    private String page;
    @Column(name = "detail", length = 100)
    private String detail;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "joinDate")
    private Date joinDate;

}
